<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>判断月份天数</title>
</head>

<body>
  <script>
    function DaysInMonth(month) {
      switch (month) {
        case 4 || 6 || 9 || 11:
          alert("这个月30天");
          break;
        case 2:
          alert("这个月28天");
          break;
          default:alert("这个月31天")
      }
    }
    DaysInMonth(1);
    DaysInMonth(4);
    DaysInMonth(5);
    DaysInMonth(7);
  </script>
</body>

</html>